//
//  GQHServiceController.m
//  Xanthium
//
//  Created by GuanQinghao on 08/02/2018.
//  Copyright © 2018 GuanQinghao. All rights reserved.
//

#pragma mark Macro
#import "GQHHeader.h"

#pragma mark Model

#pragma mark Object

#pragma mark View
#import "GQHServiceView.h"

#pragma mark Controller
#import "GQHServiceController.h"
#import "GQHServiceWebController.h"

#pragma mark CocoaPods

#pragma mark ----------Header End----------

@interface GQHServiceController () {
    
#pragma mark Data
    
#pragma mark View
    /// 自定义根视图
    GQHServiceView *rootView;
}

@end


@implementation GQHServiceController

#pragma mark --Lifecycle
- (void)loadView {
    DLog();
    
    rootView = [[GQHServiceView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.view = rootView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    DLog();
    
    [self clickServiceButtonBlock];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    DLog();
    
    self.qh_leftButton.hidden = YES;
    self.qh_titleLabel.text = @"服务";
    self.qh_rightButton.hidden = YES;
    self.automaticallyAdjustsScrollViewInsets = NO;
}

#pragma mark --Delegate

#pragma mark --TargetMethod

#pragma mark --PrivateMethod
- (void)clickServiceButtonBlock {
    
    GQH_WEAKSELF;
    rootView.clickServiceButtonBlock = ^(UIButton *button) {
        
        [weakSelf showToastWithText:@"近期即将开通，敬请期待"];
//        switch (button.tag) {
//
//            case 10: {
//
//                GQHServiceWebController *webController = [[GQHServiceWebController alloc] init];
//                webController.hidesBottomBarWhenPushed = YES;
//                webController.qh_navCaptionString = @"途途行";
//                webController.qh_URLString = @"http://www.tuniu.com";
//                [weakSelf.navigationController pushViewController:webController animated:YES];
//            }
//                break;
//            case 11: {
//
//                GQHServiceWebController *webController = [[GQHServiceWebController alloc] init];
//                webController.hidesBottomBarWhenPushed = YES;
//                webController.qh_navCaptionString = @"ETC";
//                webController.qh_URLString = @"https://www.bjetc.cn";
//                [weakSelf.navigationController pushViewController:webController animated:YES];
//            }
//                break;
//            case 12: {
//
//                GQHServiceWebController *webController = [[GQHServiceWebController alloc] init];
//                webController.hidesBottomBarWhenPushed = YES;
//                webController.qh_navCaptionString = @"保险";
//                webController.qh_URLString = @"http://insurance.hexun.com";
//                [weakSelf.navigationController pushViewController:webController animated:YES];
//            }
//                break;
//            case 13: {
//
//                GQHServiceWebController *webController = [[GQHServiceWebController alloc] init];
//                webController.hidesBottomBarWhenPushed = YES;
//                webController.qh_navCaptionString = @"加油卡";
//                webController.qh_URLString = @"http://www.card.petrochina.com.cn";
//                [weakSelf.navigationController pushViewController:webController animated:YES];
//            }
//                break;
//            default:
//                break;
//        }
    };
}

#pragma mark --Setter

#pragma mark --Getter

@end
